package com.aruba.hiltapplication

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import androidx.lifecycle.ViewModelProvider
import com.aruba.hiltapplication.di.datasource.DataSource
import com.aruba.hiltapplication.interfaces.ICallback
import com.aruba.hiltapplication.viewmodels.UserViewModel
import dagger.hilt.android.AndroidEntryPoint
import javax.inject.Inject
import javax.inject.Named

@AndroidEntryPoint
class ViewModelActivity : AppCompatActivity() {
    val viewModel: UserViewModel by lazy {
        ViewModelProvider(this).get(UserViewModel::class.java)
    }

    @Inject
    lateinit var callback: ICallback

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_view_model)

        Log.i("aruba_log", viewModel.userInfo.name)
        Log.i("aruba_log", viewModel.userInfo2.name)

        callback.onSuccess()
    }
}